package com.gy.api.pc.message.service.impl;

import com.gy.api.pc.message.dao.MessageInfoDao;
import com.gy.api.pc.message.domain.po.MessageInfoPO;
import com.gy.api.pc.message.domain.vo.MessageInfoAddDto;
import com.gy.api.pc.message.service.IMessageInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;


@Service
@Transactional
@Slf4j
public class MessageInfoServiceImpl implements IMessageInfoService {
    @Autowired
    MessageInfoDao messageInfoDao;


    @Override
    public void addSave(MessageInfoAddDto addDto) {
        MessageInfoPO messageInfoPO=new MessageInfoPO();
        BeanUtils.copyProperties(addDto, messageInfoPO);
        messageInfoPO.preInsert();
        messageInfoDao.insertSelective(messageInfoPO);
    }
}